package com.mobeedom.android.justinstalled.db;

import java.io.Serializable;
import java.text.SimpleDateFormat;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@SuppressWarnings("serial")
@DatabaseTable(tableName = "installedappinfo")
public class InstalledAppInfo implements Serializable {
	static final String dateRecFormat = "yyyy/MM/dd HH:mm";
	static SimpleDateFormat formatter = new SimpleDateFormat(dateRecFormat);
	
	@DatabaseField(generatedId = true, allowGeneratedIdInsert = true)
	private Integer id;

	@DatabaseField
	protected String appName;
	@DatabaseField
	protected String packageName;
	@DatabaseField(index = true)
	protected long installDate;
	@DatabaseField(dataType=DataType.BYTE_ARRAY)
	protected byte[] appIcon;

	public InstalledAppInfo() {
	}

	public InstalledAppInfo(String appName, String packageName, long installDate, byte[] appIcon) {
		this.appName = appName;
		this.packageName = packageName;
		this.installDate = installDate;
		this.appIcon = appIcon;
	}

	public InstalledAppInfo(String appName, String packageName, long installDate) {
		this.appName = appName;
		this.packageName = packageName;
		this.installDate = installDate;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public long getInstallDate() {
		return installDate;
	}

	public void setInstallDate(long installDate) {
		this.installDate = installDate;
	}

	public byte[] getAppIcon() {
		return appIcon;
	}

	public void setAppIcon(byte[] appIcon) {
		this.appIcon = appIcon;
	}

}
